package com.cs.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cs.domain.ProdPropValue;
import com.cs.mapper.ProdPropValueMapper;
import com.cs.service.ProdPropValueService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class ProdPropValueServiceImpl extends ServiceImpl<ProdPropValueMapper, ProdPropValue> implements ProdPropValueService{
    @Autowired
    private ProdPropValueMapper prodPropValueMapper;
    /**
     * 通过规格id查询规格值
     *
     * @param propId
     * @return
     */
    @Override
    public List<ProdPropValue> findPropValueByPropId(Long propId) {
        List<ProdPropValue> prodPropValues = prodPropValueMapper.selectList(new LambdaQueryWrapper<ProdPropValue>().eq(ProdPropValue::getPropId, propId));
        return prodPropValues;
    }
}
